package org.ljy.testdemo.common;

import lombok.Data;

@Data
public class Result<T> {
    private String message;
    private int code;
    private T data;

    public Result(String message,int code) {
        this.message = message;
        this.code = code;
    }
    public Result(String message,int code,T data) {
        this.message = message;
        this.code = code;
        this.data = data;
    }

    public static Result fail(String message) {
        return new Result(message,1314);
    }

    public static Result success(String message) {
        return new Result(message,1314);
    }

    public static <T> Result success(T data) {
        return new Result("success",1314,data);
    }
}
